import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

import static java.lang.Math.*;
public class TaskA extends Thread {
    public TaskA() {
        this.setPriority(Thread.MAX_PRIORITY);
    }

    public void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            int cnt[] = new int[3];
            for (int c = 0; c < 3; ++c) {
                String first = in.readLine();
                for (int i = 0; i < first.length(); ++i) {
                    if (first.charAt(i) == 'a' || first.charAt(i) == 'e' || first.charAt(i) == 'i' ||
                            first.charAt(i) == 'o' || first.charAt(i) == 'u') {
                        cnt[c]++;
                    }
                }
            }
            if (cnt[0] == 5 && cnt[1] == 7 && cnt[2] == 5){
                out.println("YES");
            }
            else{
                out.println("NO");
            }
            out.flush();
            out.close();
        } catch (Throwable e) {
            System.err.println("Exception from runtime....");
            handleException(e);
        }
    }


    public static void main(String[] args) {
        try {
            new TaskA().start();
        } catch (Throwable e) {
            handleException(e);
        }
    }

    private static void handleException(Throwable e) {
        System.err.println(e.getMessage());
        System.err.println(e.getStackTrace());
    }

    private BufferedReader in;
    private PrintWriter out;
}